$(function () {
    $('.login_form .input_sub').click(function (e) {
        e.preventDefault();
        let password = $('.login_form .input_pass').val().trim();
        let username = $('.login_form .input_txt').val().trim();
        if (!password && !username) {
            $('.modal-body p').text('用户名和密码不能为空!');
            $('#myModal').modal('show');
            return;
        } else {
            $.ajax({
                type: 'post',
                url : BigNew.user_login,
                data: {
                    username,
                    password
                },
                success(data) {
                    $('.modal-body p').text(data.msg);
                    window.localStorage.setItem('token', data.token);
                    $('#myModal').modal('show');
                    if (data.code == 200) {
                        $('#myModal').on('hidden.bs.modal', function (e) {
                            window.location.href = "./index.html";
                        });
                    }
                }
                
             })
           
        }
       

    })
})